<%--
  Created by IntelliJ IDEA.
  User: 73786
  Date: 2021/4/7
  Time: 20:49
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>管理主页</title>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body{
            background-image: url("${pageContext.request.contextPath}/css/cat.jpg");
            background-color: red;
        }
    </style>
</head>
<body>
<h1>欢迎${user.uname}先生，下面是一些宠物领养站动态圈</h1>

<div class="container">

    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="page-header">
                <h1>
                    <small>宠物列表 ----- 显示所有宠物</small>
                    <small><a href="${pageContext.request.contextPath}/index.jsp">退出</a></small>
                </h1>
            </div>
        </div>

        <div class="row">
            <div class="col-md-4 column">
                <%--                toAddDog--%>
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/dog/toadd">发布送养需求</a>
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/dog/allDog">显示全部需求</a>
            </div>
            <div class="col-md-8 column">
                <%--                查询宠物--%>
                <form class="form-inline" action="${pageContext.request.contextPath}/dog/queryDogByText" method="post" style="float: right">
                    <input type="text" name="dtext" class="form-control" placeholder="请输入要查询的宠物信息" />
                    <span style="color: red" font-weight="bold" >${error}</span>
                    <input type="submit" value="查询" class="btn btn-primary" />
                </form>
            </div>
        </div>
    </div>

    <div class="row clearfix">
        <div class="col-md-12 column">
            <table class="table table-hover table-striped">
                <thead>
                <tr>
                    <th>宠物编号</th>
                    <th>宠物标题</th>
                    <th>宠物信息</th>
                    <th>联系方式</th>
                    <th>发布时间</th>
                    <th>交易地点</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
                </thead>
                <%--                宠物从数据库中查询出来，从这个list中遍历出来： foreach--%>
                <tbody>
                <c:forEach var="dog" items="${list}">
                    <tr>
                        <td>${dog.did}</td>
                        <td>${dog.dtitle}</td>
                        <td>${dog.dtext}</td>
                        <td>${dog.phone}</td>
                        <td>${dog.subtime}</td>
                        <td>${dog.adress}</td>
                        <td>${dog.state}</td>
                        <td>
                            <a href="${pageContext.request.contextPath}/dog/deleteDog?id=${dog.did}">点赞</a>
                            &nbsp; | &nbsp;
                            <a href="${pageContext.request.contextPath}/dog/deleteDog?id=${dog.did}">删除</a>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>


</div>
<h3 style="margin-left: 450px; margin-top: 800px">
    <div>
        <div>
            <a href="#">帮助文档</a>
            <a href="#">领养条件文档</a>
            <a href="#">宠物抚养注意事项</a>
            <a href="#">紧急情况联系方式</a>
        </div>
    </div>
</h3>
</body>
</html>
